const App = getApp();

Component({

  options: {
    addGlobalClass: true,
  },

  /**
   * 组件的属性列表
   * 用于组件自定义设置
   */
  properties: {
    itemIndex: String,
    itemStyle: Object,
    dataList: Object
  },
 data:{
    shop_index : Number
 },

  /**
   * 组件的方法列表
   * 更新属性和数据的方法与更新页面数据的方法类似
   */
  methods: {

    /**
     * 跳转门店详情页
     */
    _onTargetDetail(e) {
      // 记录formid
      App.saveFormId(e.detail.formId);
      console.log('进入子组件方法');
      console.log(e);
     this.shop_index = this.data.dataList.index;
      // let shop_index = e.currentTarget.dataset.index;
        var current_area = {current_area:e.currentTarget.dataset.shop_name} // detail对象，提供给事件监听函数
        var myEventOption = {} // 触发事件的选项
        this.triggerEvent('shoptoggle', current_area, myEventOption)


        // wx.navigateBack({
        //   delta: 1,
        //   success: (res) => {},
        //   fail: (res) => {},
        //   complete: (res) => {},
        // })
      // wx.navigateTo({
      //   url: '/pages/shop/detail/index?shop_id=' + e.detail.target.dataset.id,
      // });
    },
    toggleShop(e){
        this.setData({
          //  shopname = this.dataItem.shop_name,
          //  shopAddress = this.dataItem.region.province +  this.dataItem.region.city + this.dataItem.region.region + this.dataItem.address,
          //  shopNumber = this.dataItem.phone
        })
    }
  },
})